<template>
  <slot name="twoMenu">
    <template v-for="(item,index) in menuList">
      <a-menu-item v-if="item.children && item.children.length == 0" :key="index">
        <a-icon :type="item.ico" />
        <span>{{item.title}}</span>
      </a-menu-item>
      <a-sub-menu :key="'sub' + index" v-else>
        <span slot="title">
          <a-icon :type="item.ico" />
          <span>{{item.title}}</span>
        </span>
        <a-menu-item v-for="(itemChild,indexChild) in item.children">
          <router-link :to="item.path + '/'+ itemChild.path" :key="indexChild">{{itemChild.title}}</router-link>
        </a-menu-item>
      </a-sub-menu>
    </template>
  </slot>
</template>
<script>
export default {
  name: "menuSlot",
  computed: {
    menuList: function() {
      return this.$store.state.MENU_CONFIG;
    }
  }
};
</script>